# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

_pyname=traitlets
pkgname=python-$_pyname
pkgver=5.9.0
pkgrel=2
pkgdesc='A configuration system for Python applications'
arch=(any)
url='https://traitlets.readthedocs.io/en/stable'
license=(BSD)
depends=(python-decorator)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest)
source=(https://pypi.python.org/packages/source/t/traitlets/traitlets-$pkgver.tar.gz)
sha256sums=('f6cde21a9c68cf756af02035f72d5a723bf607e862e7be33ece505abf4a3bad9')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  pytest -v
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
